package com.group.project.hrms.service.impl;

import com.group.project.hrms.entity.StandardBaseAttendChargeBack;
import com.group.project.hrms.mapper.StandardBaseAttendChargeBackMapper;
import com.group.project.hrms.service.IStandardBaseAttendChargeBackService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import tk.mybatis.mapper.entity.Example;

import java.util.List;

@Service
public class StandardBaseAttendChargeBackService implements IStandardBaseAttendChargeBackService {

    @Autowired
    private StandardBaseAttendChargeBackMapper standardBaseAttendChargeBackMapper;


    @Override
    public int insertStandardBaseAttendChargeBack(StandardBaseAttendChargeBack baseAttendChargeBack) {
        return standardBaseAttendChargeBackMapper.insert(baseAttendChargeBack);
    }

    @Override
    public int deleteStandardBaseAttendChargeBack(StandardBaseAttendChargeBack baseAttendChargeBack) {
        return standardBaseAttendChargeBackMapper.deleteByPrimaryKey(baseAttendChargeBack);
    }

    @Override
    public int updateStandardBaseAttendChargeBack(StandardBaseAttendChargeBack baseAttendChargeBack) {
        return standardBaseAttendChargeBackMapper.updateByPrimaryKey(baseAttendChargeBack);
    }

    @Override
    public StandardBaseAttendChargeBack selectOneStandardBaseAttendChargeBack(StandardBaseAttendChargeBack baseAttendChargeBack) {
        return null;
    }

    @Override
    public StandardBaseAttendChargeBack selectOneStandardBaseAttendChargeBackByGroupID(String gid) {
        Example example = new Example(StandardBaseAttendChargeBack.class);
        Example.Criteria criteria = example.createCriteria();
        criteria.andEqualTo("attendGroupId" , gid);
        return standardBaseAttendChargeBackMapper.selectOneByExample(example);
    }

    @Override
    public List<StandardBaseAttendChargeBack> selectAllStandardBaseAttendChargeBack() {
        return standardBaseAttendChargeBackMapper.selectAll();
    }
}
